package com.aaa.doctor.controller.api;

import com.aaa.doctor.feign.medicinal.MedicinesFeign;
import com.aaa.entity.Medicines;
import com.aaa.vo.MedicinalVo;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author MuChengGuo
 * @date 2023/3/31 10:44
 * Description: TODO
 **/
@Api(tags = "调用药品微服务")
@RequestMapping("/doctor/api/medicinal")
@RestController
public class MedicinalApiController {
    @Autowired
    private MedicinesFeign medicinesFeign;

    @ApiOperation(value = "查询所有药品")
    @PostMapping("/medicinesList")
    public Result<IPage<Medicines>> getList(@RequestBody MedicinalVo medicinalVo) {
        IPage<Medicines> list = medicinesFeign.medicines(medicinalVo);
        return new Result(2000, "成功", list);
    }
}
